package com.aos.erp.manager.remote;

import com.aos.erp.common.bean.PageBean;
import com.aos.erp.common.bean.ResultEntity;
import com.aos.erp.manager.model.applyschool.ro.MessageRecordRo;
import com.aos.erp.manager.remote.model.MTParamInfo;
import com.aos.erp.manager.remote.model.dto.MessageRecordItemDTO;
import com.aos.erp.manager.remote.model.dto.MessageRecordWaitPushItemDTO;
import com.aos.erp.manager.remote.model.dto.MessageTemplateDTO;
import com.aos.erp.manager.remote.model.dto.MessageTemplateItemDTO;
import com.aos.erp.manager.remote.model.vo.MRConditionVo;
import com.aos.erp.manager.remote.model.vo.MTConditionVo;
import com.aos.erp.manager.remote.model.vo.MessageTemplateVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@FeignClient(name = "${erp-message-server}", url = "${erp-message-server-url}")
public interface MessageService {

    @PostMapping("/service/message/param/listAll")
    public List<MTParamInfo> queryAllMTParam();


    /**
     * 保存消息模板
     * @param params
     * @return
     */
    @PostMapping(value = "/service/message/template/add")
    ResultEntity addTemplate(MessageTemplateVo params);

    /**
     * 编辑消息模板
     * @param params
     * @return
     */
    @PostMapping(value = "/service/message/template/update")
    ResultEntity updateTemplate(MessageTemplateVo params);

    /**
     * 分页查询消息模板
     * @param condition
     * @return
     */
    @PostMapping(value = "/service/message/template/listPage")
    PageBean<MessageTemplateItemDTO> queryTemplateForPage(MTConditionVo condition);

    /**
     * 查询消息模板详情
     * @param templateId
     * @return
     */
    @PostMapping(value = "/service/message/template/detail")
    MessageTemplateDTO getMessageTemplateDetail(Long templateId);

    /**
     * 删除消息模板
     * @param ids 记录ID：id1,id2,id3
     * @return
     */
    @PostMapping(value = "/service/message/template/delete")
    ResultEntity deleteTemplate(String ids);


    /**
     * 分页查询消息记录
     * @param condition
     * @return
     */
    @PostMapping(value = "/service/message/record/listPage")
    PageBean<MessageRecordItemDTO> queryRecordForPage(MRConditionVo condition);

    /**
     * 分页查询待发消息记录
     * @param condition
     * @return
     */
    @PostMapping(value = "/service/message/record/listWaitPushRecord")
    PageBean<MessageRecordWaitPushItemDTO> queryWaitPushRecordForPage(MRConditionVo condition);

    /**
     * 删除消息记录
     * @param ids 记录ID：id1,id2,id3
     * @return
     */
    @PostMapping(value = "/service/message/record/delete")
    ResultEntity deleteRecord(String ids);
    /**
     * 发送短信
     * @param params
     * @return
     */
    @PostMapping(value = "/service/message/sendSmsMessage")
    ResultEntity sendSmsMessage(MessageRecordRo params);
}
